package br.com.upper.action;

import java.util.Map;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;

public class UpperSupport extends ActionSupport implements Preparable, SessionAware {

	private Map<String, Object> sessionMap;
	
	public boolean isPostMethod() {
		String method = ServletActionContext.getRequest().getMethod();
		if(method != null && method.equalsIgnoreCase("post")) {
			return true;
		}
		return false;
	}

	public boolean isGetMethod() {
		String method = ServletActionContext.getRequest().getMethod();
		if(method != null && method.equalsIgnoreCase("get")) {
			return true;
		}
		return false;
	}

	@Override
	public void prepare() throws Exception {

	}

	@Override
	public void setSession(Map<String, Object> sessionMap) {
		this.sessionMap = sessionMap;
	}

	public Map<String, Object> getSessionMap() {
		return sessionMap;
	}
	
	
	
}
